/api/user/files/:id

View, update, or delete a specific file you own (by ID or filename).

Info

This endpoint requires authentication.

Path Parameters

ParameterTypeDescription
idstringRequired. File ID or filename.

GET
Request

Response

Status: 200 OK

Content-Type: application/json

Returns a File object.

PATCH
Request

Update file properties (favorite status, max views, password, tags, etc).

Body

Content-Type: application/json

PropertyTypeDescription
favoriteboolean?Set/unset as favorite.
maxViewsnumber?Max allowed views (>= 0).
passwordstring?~Set password (string), remove password (null or empty string).
originalNamestring?Set or update the original filename.
typestring?Set or update the file MIME type.
tagsstring[]?Array of tag IDs to set for this file.

Example

{
"favorite": true,
"maxViews": 100,
"password": "newpassword",
"originalName": "newfile.txt",
"type": "text/plain",
"tags": ["tag1", "tag2"]
}

Response

Status: 200 OK

Content-Type: application/json

Returns an updated File object.

Error Responses

  • 400 Bad Request

    • If the request body is invalid or missing required fields
    • Number fields are invalid or out of range
    • Tags provided are invalid or do not exist
  • 404 Not Found

    • If the file with the specified ID or filename does not exist
    • If the file does not belong to the authenticated user

DELETE
Request

Delete a specific file by ID or filename.

Response

Status: 200 OK

Content-Type: application/json

Returns a File object representing the deleted file.

Error Responses

  • 404 Not Found

    • If the file with the specified ID or filename does not exist
    • If the file does not belong to the authenticated user


Last updated: 6/1/2025
Edit this page on GitHub